package com.example.course.bean;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 活动表
 * @Date 2025-04-22 15:36:52
 * @author Jasmine-drs
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("activity")
@ApiModel(value="Activity对象", description="活动表")
public class Activity implements Serializable {

    @NotNull(message="[主键]不能为空")
    @ApiModelProperty("主键")
    private Integer id;

    @NotBlank(message="[标题]不能为空")
    @Size(max= 32,message="编码长度不能超过32")
    @ApiModelProperty("标题")
    private String title;

    @NotBlank(message="[内容介绍]不能为空")
    @ApiModelProperty("内容介绍")
    private String introduction;

    @NotBlank(message="[封面图地址]不能为空")
    @Size(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("封面图地址")
    private String coverUrl;

    @NotNull(message="[创建时间]不能为空")
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @NotNull(message="[更新时间]不能为空")
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
